package com.mlog.njyjy.ndop.monitor.collector.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @author zyz
 * @version v1.0, 2020/07/27
 */
@Configuration
public class ScheduleConfiguration {

    /**
     * 定时任务调度器
     *
     * @return
     */
    @Bean
    public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
        ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
        scheduler.setPoolSize(1000);
        scheduler.setDaemon(false);
        scheduler.setThreadGroupName("pdt-monitor-scheduler");
        scheduler.setThreadNamePrefix("pdt-monitor-");
        return scheduler;
    }
}
